<template>
  <span>{{dateNow}} {{timeNow}}</span>
</template>

<script>
export default {
  name: "dateLine",
  data () {
    return {
      dateNow : '',
      timeNow : ''
    }
  },
  methods : {
    now () {
      let dateSingle = new Date();
      this.dateNow = dateSingle.toLocaleDateString()
      this.timeNow = dateSingle.toLocaleTimeString()
    },
    refresh () {
      setInterval(this.now,1000);
    }
  },
  mounted () {
    this.refresh()
  }
}
</script>

<style scoped>

</style>